<?php
 	if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
 
 	class MY_Controller extends CI_Controller{
 		public $user;
		public $screen;
   		function __construct() {
    		parent::__construct();
			if(isset($this->session->userdata['user'])){
				$this->user = $this->session->userdata['user'];
				// $this->ci_smarty->assign("username", $this->user['username']);
			}
			// if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')) {//是否微信访问
			// 	$this->ci_smarty->assign("isweixin", 1);				
			// }else {
			// 	$this->ci_smarty->assign("isweixin", 0);
			// }
			// if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'QQ')) {//是否微信访问
			// 	$this->ci_smarty->assign("isqq", 1);				
			// }else {
			// 	$this->ci_smarty->assign("isqq", 0);
			// }
			
			//$this->load->model('public_configs');
			//$public_configs_info = $this->public_configs->get_public_config_info(1);
			//$this->ci_smarty->assign("public_config", $public_configs_info);
			
			//$this->screen = "dami";//portrait
			
		}

		function check_login(){
			if( ! isset($this->session->userdata['user'])){
				echo "请先登录";
				exit;
			}
		}
	}